/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.cggveritas.crewintranet.jms.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.codehaus.jackson.annotate.JsonIgnore;

/**
 *
 * @author Alassane
 */
@Entity
@Table(name = "cv_typeprime")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CvTypeprime.findAll", query = "SELECT c FROM CvTypeprime c"),
    @NamedQuery(name = "CvTypeprime.findByTypeprime", query = "SELECT c FROM CvTypeprime c WHERE c.typeprime = :typeprime"),
    @NamedQuery(name = "CvTypeprime.findByPrime", query = "SELECT c FROM CvTypeprime c WHERE c.prime = :prime"),
    @NamedQuery(name = "CvTypeprime.findByValeur", query = "SELECT c FROM CvTypeprime c WHERE c.valeur = :valeur")})
public class CvTypeprime implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "typeprime")
    private String typeprime;
    @Basic(optional = false)
    @Column(name = "prime")
    private String prime;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "valeur")
    private BigDecimal valeur;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "cvTypeprime", fetch = FetchType.LAZY)
    private List<CvTravailprime> cvTravailprimeList;

    public CvTypeprime() {
    }

    public CvTypeprime(String typeprime) {
        this.typeprime = typeprime;
    }

    public CvTypeprime(String typeprime, String prime) {
        this.typeprime = typeprime;
        this.prime = prime;
    }

    public String getTypeprime() {
        return typeprime;
    }

    public void setTypeprime(String typeprime) {
        this.typeprime = typeprime;
    }

    public String getPrime() {
        return prime;
    }

    public void setPrime(String prime) {
        this.prime = prime;
    }

    public BigDecimal getValeur() {
        return valeur;
    }

    public void setValeur(BigDecimal valeur) {
        this.valeur = valeur;
    }

    @XmlTransient
    @JsonIgnore
    public List<CvTravailprime> getCvTravailprimeList() {
        return cvTravailprimeList;
    }

    public void setCvTravailprimeList(List<CvTravailprime> cvTravailprimeList) {
        this.cvTravailprimeList = cvTravailprimeList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (typeprime != null ? typeprime.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CvTypeprime)) {
            return false;
        }
        CvTypeprime other = (CvTypeprime) object;
        if ((this.typeprime == null && other.typeprime != null) || (this.typeprime != null && !this.typeprime.equals(other.typeprime))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.cggveritas.crewintranet.jms.entities.CvTypeprime[ typeprime=" + typeprime + " ]";
    }
    
}
